//
//  FKCacheTool.h
//  FKLibraryExample
//
//  Created by frank on 2018/8/13.
//  Copyright © 2018年 zmosa - frank. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "UserModel.h"
#import "FKLastPlayMedia.h"

@interface FKCacheTool : NSObject

UIKIT_EXTERN NSString * FKPath(NSString *path);

+ (void)saveToken:(NSString *)token;
+ (NSString *)getToken;

+ (BOOL)isLogin;
+ (void)logout;

// 缓存“内容版本号”
+ (void)saveContentVersion:(NSString *)version;
// 获取“内容版本号”
+ (NSString *)contentVersion;
+ (BOOL)isHasUpdateOfContent;

// 缓存“线上最新版本号”
+ (void)saveOnlineVersion:(NSString *)version;
// 获取“线上最新版本号”
+ (NSString *)onlineVersion;

// 用户信息
+ (void)saveUserInfo:(NSDictionary *)userInfo;
+ (UserModel *)userInfo;
// 保存上一次登录的用户名
+ (void)saveLastLoginName:(NSString *)loginName;
+ (NSString *)lastLoginName;
// 保存上一次登录的手机号
+ (void)saveLastMobile:(NSString *)mobile;
+ (NSString *)lastMobile;


// 缓存上次选中的“班级信息”
+ (void)saveClassInfo:(NSDictionary *)classInfo;
// 获取上次选中的“班级信息”
+ (NSDictionary *)classInfo;
// 通过分类id查询分类数据
+ (void)getCateData:(NSString *)cateId complete:(void (^)(id data))complete;
// 通过id查询index数据
+ (void)getIndexData:(NSString *)cateId complete:(void (^)(id data))complete;
// 查询小分类列表
+ (void)getCateList:(NSString *)cateId complete:(void (^)(id data))complete;
// 查询单个媒体详情数据
+ (void)getMediaDetail:(NSString *)mediaId complete:(void (^)(id data))complete;
// 清除缓存的接口数据
+ (void)clearRequestData;
// 设置是否开启“历史记录”
+ (void)setHistoryRecord:(BOOL)state;
// 是否开启“历史记录”
+ (BOOL)isOpenHistoryRecord;
// 设置是否开启“搜索记录”
+ (void)setSearchRecord:(BOOL)state;
// 是否开启“搜索记录”
+ (BOOL)isOpenSearchRecord;
// 缓存上次播放的视频
+ (void)saveLastPlayVideo:(FKLastPlayMedia *)info;
// 移除上次播放的视频缓存记录
+ (void)removeLastPlayVideo;
// 获取上次播放的视频
+ (FKLastPlayMedia *)lastPlayVideo;




#pragma mark - 文件缓存
+ (void)fk_setObject:(id)object forPath:(NSString *)path;
+ (id)fk_objectForPath:(NSString *)path;
+ (void)fk_removeObjectForPath:(NSString *)path;




@end

